{block name=body}
<div class="row">
	<div class="col-sm-12">
			<h2 class="title">出勤情况</h2>
			<form class="form" id="FilterClassesDropdown-form" role="form" accept-charset="UTF-8" action="" method="post">
				<input type="hidden" value="FilterClassesDropdownByTerm" name="action"/> 
				<input type="hidden" value="/admin/includes/processes/processes-enrolment.php" name="url"/> 
				<input type="hidden" name="formToken" value="{$token}" />
				<input type="hidden" name="weeks" value="{$terms.0.weeks}" id="weeks" />
				<input type="hidden" name="current_week" value="{$terms.0.current_week}" id="current_week" />
				<input type="hidden" name="term_name" value="{$terms.0.term_name} - {$terms.0.term_region}" id="term_name" />

				<div class="form-group col-sm-12 reports-admin" style="border-right:none; padding: 15px 20px 25px;">
					<label for="term_object_id">选择学期:</label><br>
                    <select class="select-dropdown" name="term_object_id" id="term_object_id">
                        {foreach $terms as $term} 
                            <option value="{$term.term_object_id}" data-weeks="{$term.weeks}" data-current="{$term.current_week}">{$term.term_name}</option>
                        {/foreach}
                    </select>
				</div>
				<div class="error-alert" style="display:none;">
         	<div class="alert alert-danger fade in ">
						<button class="close" aria-hidden="true" type="button" onclick="$(this).closest('.error-alert').fadeOut('slow');">&times;</button>
						<strong></strong>
					</div>
         </div>
			</form>
	</div>
</div>

<div class="row">
	<div class="col-sm-12">
		<div id="attendance-form-wrapper" class="form-wrapper" >
			{include file="classterm-list-attendance.tpl"}
 		</div>
	</div>
</div>
{/block}

{block name=tail}
	<script type="text/javascript">
		
	$(function() {	
			$('#FilterClassesDropdown-form').validate();
			$('#term_object_id').change(function(){
				$('#weeks').val( $(this).find('option:selected').attr('data-weeks') );
				$('#current_week').val( $(this).find('option:selected').attr('data-current') );
				$('#term_name').val( $(this).find('option:selected').text() );
				$('#FilterClassesDropdown-form').submit();
			});

			$('#attendance-roll-form').validate();
		});
	</script>

{/block}
	